<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!-- Load the resource bundle -->

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Trang chủ</title>
    </h:head>
    <h:body>
        <ui:composition> 
            <c:set var="dstheosoluongban" value="${dansachdienthoai.getDanhsachtheosoluongban()}" />
            <c:set var="dstheosoluongxem" value="${dansachdienthoai.getDanhsachtheosoluongxem()}" />

            <h:graphicImage width="750" height="10" style="background-color: black " />

            Top điện thoại bán chạy nhất

            <h:graphicImage width="750" height="10" style="background-color: black " />
            <table width="746" border="1">
                <c:forEach var ="ii" begin="0" end="3">
                    <tr>
                        <c:forEach var ="i" begin="0" end="3">
                            <c:set var="tt" value="${(ii*4+i)}"/>
                            <c:if test="${dansachdienthoai.getDanhsachtheosoluongban().size()>tt}">
                                <c:set var="dt" value="${dansachdienthoai.getDanhsachtheosoluongban().get(tt)}"/>  






                                <td width="186" height="220" align="center" >



                                    <c:set var="madienthoai" value="${dt.madienthoai}"/>

                                    <h:commandLink action="#{detailmobile.setThongtin1sanpham(madienthoai)}">
                                        <h:graphicImage library="images"  name="${dt.hinhanh.replace('ô', 'o')}"  height="186" width="186"/>
                                    </h:commandLink>

                                    <br/>
                                    <br/>

                                    <c:set var="tendt" value="${dt.tendienthoai}"/>
                                    <c:set var="madt" value="${dt.madienthoai}"/>
                                    <h:outputText value="${tendt}"/>
                                    <c:set var="giadt" value="${dt.giaban}"/>
                                    <br/>
                                    <h:outputText value="${dt.giaban}">
                                        <f:convertNumber type="currency"  currencyCode="VND" groupingUsed="true"  maxFractionDigits="0"/> 
                                    </h:outputText>
<br/>
                                    <h:commandLink action="#{GioHang.setAddHangTrongGio(madt)}">
                                        <h:graphicImage library="images"  name="themvaogio.jpg"  />
                                    </h:commandLink>


                                </td>
                            </c:if>
                        </c:forEach>
                    </tr>  
                </c:forEach>
            </table>
            <br/>
            <h:graphicImage width="750" height="10" style="background-color: black " />

            Top điện thoại mới nhất

            <h:graphicImage width="750" height="10" style="background-color: black " />
            <table width="746" border="1">
                <c:forEach var ="ii" begin="0" end="3">
                    <tr>
                        <c:forEach var ="i" begin="0" end="3">
                            <c:set var="tt" value="${(ii*4+i)}"/>
                            <c:if test="${dansachdienthoai.getDanhsachtheosoluongxem().size()>tt}">
                                <c:set var="dt" value="${dansachdienthoai.getDanhsachtheosoluongxem().get(tt)}"/>  






                                <td width="186" height="220" align="center" >



                                    <c:set var="madienthoai" value="${dt.madienthoai}"/>

                                    <br/>
                                    <h:commandLink action="#{detailmobile.setThongtin1sanpham(madienthoai)}">
                                        <h:graphicImage library="images"  name="${dt.hinhanh.replace('ô', 'o')}"  height="186" width="186"/>
                                    </h:commandLink>

                                    <br/>
                                    <br/>

                                    <c:set var="tendt" value="${dt.tendienthoai}"/>
                                    <c:set var="madt" value="${dt.madienthoai}"/>
                                    <h:outputText value="${tendt}"/>
                                    <c:set var="giadt" value="${dt.giaban}"/>
                                    <br/>
                                    <h:outputText value="${dt.giaban}">
                                        <f:convertNumber type="currency"  currencyCode="VND" groupingUsed="true"  maxFractionDigits="0"/> 
                                    </h:outputText>
                                    
                                    <br/>
                                    <h:commandLink action="#{GioHang.setAddHangTrongGio(madt)}">
                                        
                                        <h:graphicImage library="images"  name="themvaogio.jpg"  />
                                    </h:commandLink>


                                </td>
                            </c:if>
                        </c:forEach>
                    </tr>  
                </c:forEach>
            </table>

        </ui:composition>
    </h:body>
</html>